package cn.lbwfree.day3_24;

import java.util.Scanner;

/**
 * @date:2020年3月24日
 * @author:lbwfree
 * @number:BASIC-15 字符串对比
 */
public class Stringequal {
	public static void main(String[] args) {
		Scanner inScanner = new Scanner(System.in);
		String f1 = inScanner.nextLine();
		String f2 = inScanner.nextLine();
		if(f1.length()!=f2.length())
		{
			System.out.println(1);
		}else {
			if(f1.equals(f2))
			{
				System.out.println(2);
			}else {
				if(f1.toLowerCase().equals(f2.toLowerCase()))
				{
					System.out.println(3);
				}else {
					System.out.println(4);
				}
			}
		}
		
		
	}
}
